<h2>clock_alarm</h2>
<hr>
<p>
<strong>Function</strong> - Set off an alarm.
<h3>SYNOPSIS</h3>
<pre>
<strong>kern_return_t   clock_alarm</strong>
                <strong>(clock_t</strong>                             <var>clock_name</var>,
                 <strong>alarm_type_t</strong>                        <var>alarm_type</var>,
                 <strong>tvalspec_t</strong>                          <var>alarm_time</var>,
                 <strong>mach_port_t</strong>                   <var>alarm_reply_port</var><strong>);</strong>
</pre>
<h3>PARAMETERS</h3>
<dl>
<p>
<dt> <var>clock_name</var> 
<dd>
[in clock-name send right]
The name (or control) port for the clock.
<p>
<dt> <var>alarm_type</var> 
<dd>
[in scalar]
How to interpret the <var>alarm_time</var> value:
<dl>
<p>
<dt> <strong>TIME_RELATIVE</strong>
<dd>
Interpret the alarm time as relative to the current time.
<p>
<dt> <strong>TIME_ABSOLUTE</strong>
<dd>
Interpret the alarm time as an absolute time.
</dl>
<p>
<dt> <var>alarm_time</var> 
<dd>
[in structure]
The time when the alarm is to be sent.
<p>
<dt> <var>alarm_reply_port</var> 
<dd>
[in alarm receive (to be converted to send-once) right]
A port into 
which the alarm message is to be sent.
</dl>
<h3>DESCRIPTION</h3>
<p>
The <strong>clock_alarm</strong> function requests that a clock send
an alarm message to a 
specified port at a given future time.  The alarm message is specified by the 
<strong>clock_alarm_reply</strong> server interface.
<h3>NOTES</h3>
<p>
If the specified alarm time is in the past, the alarm message
is sent immediately 
and time-stamped with the current time.  Otherwise, the alarm is queued and
delivered at the specified alarm time and time-stamped at that time.
<p>
The alarm will be serviced at the service time nearest the specified
alarm time 
as governed by the current clock alarm resolution.
<p>
Not all clocks implement this service, but the REALTIME clock must.  If the 
clock does not provide this service, this call is ignored.
<h3>RETURN VALUES</h3>
<p>
Only generic errors apply.
<h3>RELATED INFORMATION</h3>
<p>
Functions:
<a href="host_get_clock_service.html"><strong>host_get_clock_service</strong></a>,
<a href="clock_get_attributes.html"><strong>clock_get_attributes</strong></a>,
<a href="clock_get_time.html"><strong>clock_get_time</strong></a>,
<a href="clock_sleep.html"><strong>clock_sleep</strong></a>,
<a href="clock_alarm_reply.html"><strong>clock_alarm_reply</strong></a>.
<p>
Data Structures:
<a href="tvalspec.html"><strong>tvalspec</strong></a>.
